package com.ruoyi.system.projectapply.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.projectapply.mapper.TProjectApplyMapper;
import com.ruoyi.system.projectapply.domain.TProjectApply;
import com.ruoyi.system.projectapply.service.ITProjectApplyService;

/**
 * 申报项目Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-02
 */
@Service
public class TProjectApplyServiceImpl implements ITProjectApplyService
{
    @Autowired
    private TProjectApplyMapper tProjectApplyMapper;

    /**
     * 查询申报项目
     *
     * @param id 申报项目主键
     * @return 申报项目
     */
    @Override
    public TProjectApply selectTProjectApplyById(Long id)
    {
        return tProjectApplyMapper.selectTProjectApplyById(id);
    }

    /**
     * 查询申报项目列表
     *
     * @param tProjectApply 申报项目
     * @return 申报项目
     */
    @Override
    public List<TProjectApply> selectTProjectApplyList(TProjectApply tProjectApply)
    {
//        return tProjectApplyMapper.selectTProjectApplyList(tProjectApply);
        return tProjectApplyMapper.selectTProjectAndFilesList(tProjectApply);

    }

    /**
     * 新增申报项目
     *
     * @param tProjectApply 申报项目
     * @return 结果
     */
    @Override
    public int insertTProjectApply(TProjectApply tProjectApply)
    {
        return tProjectApplyMapper.insertTProjectApply(tProjectApply);
    }

    /**
     * 修改申报项目
     *
     * @param tProjectApply 申报项目
     * @return 结果
     */
    @Override
    public int updateTProjectApply(TProjectApply tProjectApply)
    {
        return tProjectApplyMapper.updateTProjectApply(tProjectApply);
    }

    /**
     * 批量删除申报项目
     *
     * @param ids 需要删除的申报项目主键
     * @return 结果
     */
    @Override
    public int deleteTProjectApplyByIds(Long[] ids)
    {
        return tProjectApplyMapper.deleteTProjectApplyByIds(ids);
    }

    /**
     * 删除申报项目信息
     *
     * @param id 申报项目主键
     * @return 结果
     */
    @Override
    public int deleteTProjectApplyById(Long id)
    {
        return tProjectApplyMapper.deleteTProjectApplyById(id);
    }
}
